package data.dao;

import data.entity.UserEntity;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.repository.Repository;

/**
 * Created by Administrator on 2016/11/3.
 */
@CacheConfig(cacheNames="user")
public interface UserRepository extends Repository<UserEntity, Integer> {

    @Cacheable(key="#p0")
    public UserEntity findById(Integer id);
    @Cacheable(key="#p0")
    public UserEntity findByName(String name);
}

